package com.io.nettyflow.clientHandler;

import com.io.model.CustomeMsg;
import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.ChannelInboundHandlerAdapter;

/**
 * Created by yangyx on 2016/7/20.
 */
public class CustomServerHandler extends ChannelInboundHandlerAdapter {

/*

    @Override
    protected void channelRead0(ChannelHandlerContext channelHandlerContext, Object o) throws Exception {
    if(o instanceof CustomeMsg){

        System.out.println("执行服务端处理程序类。。。。。");
        CustomeMsg customeMsg= (CustomeMsg) o;
        System.out.println("========Client->Server===="+channelHandlerContext.channel().remoteAddress()+"send"+customeMsg.getType());
    }

    }
*/
    @Override
    public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception {
        System.out.println("执行服务端处理程序类。。。。。");
        CustomeMsg customeMsg= (CustomeMsg) msg;
        System.out.println("========Client->Server===="+ctx.channel().remoteAddress()+"===send"+customeMsg.getType());
    }



}
